<?php
/**
 * 模块-前台内容控制器 
 * CommentController.php
 * ==============================================
 * 版权所有 2013-2014
 * ----------------------------------------------
 * 这不是一个自由软件，未经授权不许任何使用和传播。
 * -------------------------------
 * 
 * @package xcs
 * @author huangdaohai <huangdaohai.2007@163.com>
 * @version V1.0
 * @access public
 */
class ContentController extends Controller
{	//首页
	public function actionLists()
	{  
	   $iCatId = $this->_request->getQuery('catid');
       echo "您当前访问的是".$iCatId."栏目的内容";exit;
       $this->render('index');
	}
    public function actionShow(){
        $this->theme = 'default';
        $catid = $this->_request->getQuery('catid' ,0);
        $id = $this->_request->getQuery('id' ,0);
        //获取当前栏目详细模板
        $oCate = CategoryModel::model()->findByPk($catid);
        extract(Yii::app()->common->string2array($oCate->setting));
        $template = isset($show_template) && $show_template ?  $show_template : 'show';
        //获取详细
        $oModel = CmsModel::model()->findByPk($oCate->model_id);
        //$this->
        $sSQL = "SELECT * FROM ".Yii::app()->db->tablePrefix .'cms_'.$oModel->table_name." WHERE id=$id";
        $aQuery = Yii::app()->db->createCommand($sSQL)->queryRow();
        //print_r($aQuery);exit;
        $this->render($template ,$aQuery );
    }
}